home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / VirtualDreams_Faktory.lha / Faktory install / Install < prev    next >
Text File  |  2001-05-26  |  4KB  |  200 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")        ;sub directory containing data files
  4. (set #readme-file "ReadMe")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; checks if given program is installed, if not abort install
  10. ; #program - to check
  11.  
  12. (procedure P_ChkRun
  13.   (if
  14.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  15.     ("")
  16.     (abort
  17.       (cat
  18.     "You must install \"" #program "\" first!\n"
  19.     "It must be accessible via the path.\n"
  20.     "You can find it in the WHDLoad package."
  21.       )
  22.     )
  23.   )
  24. )
  25.  
  26. (procedure P_ChkRun_XFD
  27.   (if
  28.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  29.     ("")
  30.     (abort
  31.       (cat
  32.     "You must install \"" #program "\" first!\n"
  33.     "It must be accessible via the path.\n"
  34.     "You can find it in the XFD package."
  35.       )
  36.     )
  37.   )
  38. )
  39.  
  40. ;----------------------------
  41. ; Wait for inserting disk
  42. ; IN:  #AD_disk - name of disk
  43. ; OUT: -
  44.  
  45. (procedure P_disk
  46.   (askdisk
  47.     (dest #AD_disk)
  48.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  49.     (help @askdisk-help)
  50.   )
  51. )
  52.  
  53. ;****************************
  54.  
  55. (if
  56.   (exists #readme-file)
  57.   (if
  58.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  59.     ("")
  60.     (run ("SYS:Utilities/More %s" #readme-file))
  61.   )
  62. )
  63.  
  64. (set #program "WHDLoad")
  65. (P_ChkRun)
  66.  
  67. (set #program "xfddecrunch")
  68. (P_ChkRun_XFD)
  69.  
  70. ; in expert mode ask for source drive
  71. (if
  72.   (= @user-level 2)
  73.   (
  74.     (set #CI_drive
  75.       (askchoice
  76.     (prompt "Select source drive for diskimages")
  77.     (default 0)
  78.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  79.     (help @askchoice-help)
  80.       )
  81.     )
  82.     (select #CI_drive
  83.       (set #CI_drive "DF0:")
  84.       (set #CI_drive "DF1:")
  85.       (set #CI_drive "RAD:")
  86.       (set #CI_drive
  87.         (askstring
  88.           (prompt "Select source drive")
  89.           (default "DF0:")
  90.           (help @askstring-help)
  91.         )
  92.       )
  93.     )
  94.   )
  95.   (set #CI_drive "DF0:")
  96. )
  97.  
  98. (set @default-dest
  99.   (askdir
  100.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  101.     (help @askdir-help)
  102.     (default @default-dest)
  103.     (disk)
  104.   )
  105. )
  106. (set #dest (tackon @default-dest @app-name))
  107. (if
  108.   (exists #dest)
  109.   (
  110.     (set #choice
  111.       (askbool
  112.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  113.         (default 1)
  114.         (choices "Delete" "Skip")
  115.         (help @askbool-help)
  116.       )
  117.     )
  118.     (if
  119.       (= #choice 1)
  120.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  121.     )
  122.   )
  123. )
  124. (makedir #dest
  125.   (help @makedir-help)
  126.   (infos)
  127. )
  128.  
  129. ;----------------------------
  130.  
  131. (copyfiles
  132.   (help @copyfiles-help)
  133.   (source ("%s.Slave" @app-name))
  134.   (dest #dest)
  135. )
  136. (if
  137.   (exists ("%s.coloricon" @app-name))
  138.   (set #icon
  139.     (askchoice
  140.       (prompt "\nWhich icon would you like to install?\n")
  141.       (default 0)
  142.       (choices "Normal" "Color Icon")
  143.       (help @askchoice-help)
  144.     )
  145.   )
  146.   (set #icon 0)
  147. )
  148. (select #icon
  149.   (set #icon ("%s.inf" @app-name))
  150.   (set #icon ("%s.coloricon" @app-name))
  151. )
  152. (copyfiles
  153.   (help @copyfiles-help)
  154.   (source #icon)
  155.   (newname ("%s.info" @app-name))
  156.   (dest #dest)
  157. )
  158. (if
  159.   (exists #readme-file)
  160.   (copyfiles
  161.     (help @copyfiles-help)
  162.     (source #readme-file)
  163.     (dest #dest)
  164.   )
  165. )
  166. (if
  167.   (exists ("%s.info" #readme-file))
  168.   (copyfiles
  169.     (help @copyfiles-help)
  170.     (source ("%s.info" #readme-file))
  171.     (dest #dest)
  172.   )
  173. )
  174. (if
  175.   (= #sub-dir "")
  176.   ("")
  177.   (
  178.     (set #dest (tackon #dest #sub-dir))
  179.     (makedir #dest
  180.       (help @makedir-help)
  181.     )
  182.   )
  183. )
  184.  
  185. ;----------------------------
  186.  
  187. (set #CI_diskname "Faktory")
  188. (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  189. (if
  190.   (= 0 (run ("xfddecrunch %sFaktory.exe \"%s\" >CON:///1000//CLOSE" #CI_drive #dest)))
  191.   ("")
  192.   (abort "\"xfddecrunch\" has failed to decompress the demo")
  193. )
  194.  
  195. ;----------------------------
  196.  
  197. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  198.  
  199. (exit)
  200.